def convert(func, seq):
    '''函数中可以传递参数'''
    return [func(i) for i in seq]


numbers = [1, 4, "45", "89"]
print(convert(int, numbers))


def args_func(name, age, gender, *args):
    '''非关键字可变长参数'''
    print(" A student named %s is %d year's old, and is a %s" %
          (name, age, gender))
    if len(args) != 0:
        for i in args:
            print("" + i, )


args_func("joe", 30, "male", "football", "basketball")


def kargs_func(name, age, **kargs):
    '''关键字可变长参数'''
    print(name)
    for key, value in kargs.items():
        print(key + ":" + value)


favor = {"favor": "sports"}
# 1
kargs_func("joe", age=15, **favor)
# 2
kargs_func("joe", age=15, **{"like": "food"})
